<template>
  <h1>EL-布局组件</h1>
  <!-- 依据将屏幕分成平均的24份 进行如下操作 -->
  <!-- :gutter="总像素数" 天沟: 会根据提供的属性值的大小(像素数的大小)
  将属性值均分成两份 分别加在左右两侧形成左右外间距 左右外间距相加等于总像素数 -->
  <el-row :gutter="10">
    <el-col :span="6">EL-布局组件测试文段1</el-col>
    <el-col :span="6">EL-布局组件测试文段2</el-col>
    <el-col :span="6">EL-布局组件测试文段3</el-col>
    <el-col :span="6">EL-布局组件测试文段4</el-col>
  </el-row>
  <h3>六等份</h3>
  <el-row :gutter="10">
    <el-col :span="4"><img src="2024.png" style="width: 100%;"></el-col>
    <el-col :span="4"><img src="rich.jpg" style="width: 100%;"></el-col>
    <el-col :span="4"><img src="2024.png" style="width: 100%;"></el-col>
    <el-col :span="4"><img src="rich.jpg" style="width: 100%;"></el-col>
    <el-col :span="4"><img src="2024.png" style="width: 100%;"></el-col>
    <el-col :span="4"><img src="rich.jpg" style="width: 100%;"></el-col>
  </el-row>
  <h3>列偏移</h3>
  <!--
    每行的元素默认从左开始排列
    通过:offset=""属性可以调整 默认值为0 从左开始排序
    该属性的属性值为几 则表示元素向右移动多少列(span)

    同理 居中则为列偏移数为: (24-span属性值)/2
   -->
  <el-row :gutter="10">
    <el-col :span="20" :offset="4"><img src="2024.png" style="width: 100%;"></el-col>
  </el-row>
  <h3>列偏移: 居中</h3>
  <el-row :gutter="10">
    <el-col :span="12" :offset="6"><img src="2024.png" style="width: 100%;"></el-col>
  </el-row>
  <h3>练习: 使得3张图的宽度比为1:2:3</h3>
  <el-row>
    <el-col :span="4"><img src="2024.png" style="width: 100%"></el-col>
    <el-col :span="8"><img src="2024.png" style="width: 100%"></el-col>
    <el-col :span="12"><img src="2024.png" style="width: 100%"></el-col>
  </el-row>
  <h3>练习: 有8列 内容为1 2 ... 8 均分一行</h3>
  <el-row>
    <el-col :span="3" v-for="item in 8">{{ item }}</el-col>
  </el-row>
  <!-- 布局嵌套 -->
  <el-row :gutter="10">
    <el-col :span="12" style="border:5px solid #000">12</el-col>
    <el-col :span="12" style="border:5px solid #ff00ff">
      <!-- 将此等份看作新的整24份 供其子项瓜分 -->
      <el-row :gutter="10">
        <el-col :span="8" style="border:5px solid #000">8</el-col>
        <el-col :span="8" style="border:5px solid #808080">8</el-col>
        <el-col :span="8" style="border:5px solid #0aa1ed">8</el-col>
      </el-row>
    </el-col>
  </el-row>
</template>

<script setup>

</script>

<style scoped>

</style>